import alovaInstance from "@/utils/request";

//添加年级
export function addgrade(form) {
  return alovaInstance.Post('/collegeAdminGrade/addGrade', form)
}

//修改单个教师信息
export function updateGrade(form) {
  return alovaInstance.Put('/collegeAdminGrade/modifyGrade', form)
}

//添加单个专业信息
export function addSpeciality(form) {
  return alovaInstance.Post('/collegeAdminSpeciality/addSpeciality', form)
}

//删除专业信息
export function deleteSpeciality(id, updateBy) {
  return alovaInstance.Put(`/collegeAdminSpeciality/deleteSpeciality?specialityId=${id}&updateBy=${updateBy}`)
}

//修改专业信息
export function updateSpeciality(form) {
  return alovaInstance.Put('/collegeAdminSpeciality/updateSpeciality', form)
}

//院长终审材料
export function endCheck(form) {
  return alovaInstance.Put('/collegeAdmin/endCheck', form)
}

//院长终审通过后新增一条终审记录
export function addEndRecord(form) {
  return alovaInstance.Post('/collegeAdmin/endRecord', form)
}

//院长终审通过发送信息
export function addSuccessMessage(stuId, adminId) {
  return alovaInstance.Post(`/messageWithRole/adminAddSuccessMessToStu?stuId=${stuId}&adminId=${adminId}`)
}

//院长终审打回发送信息
export function addErrorMessage(stuId, adminId) {
  return alovaInstance.Post(`/messageWithRole/adminAddErrorMessToStu?stuId=${stuId}&adminId=${adminId}`)
}

//院长查看单个审核记录
export function checkEndRecord(id) {
  return alovaInstance.Get('/collegeAdmin/getRecordById', {
    params: {
      recordId: id
    }
  })
}
//院长分配单个申请
export function given(recordId, teach) {
  return alovaInstance.Put(`/adminGiven/givenRecords/${recordId}?teaId=${teach}`)
}

//院长分配完成，发送等待初审通知信息给学生
export function addGivenMessageStu(stuId, adminId) {
  return alovaInstance.Post(`/messageWithRole/adminAddGivenMessToStu?stuId=${stuId}&adminId=${adminId}`)
}

//院长分配完成，发送分配初审通知信息给教师
export function addGivenMessageTea(teaId, adminId) {
  return alovaInstance.Post(`/messageWithRole/adminAddGivenMessToTea?teaId=${teaId}&adminId=${adminId}`)
}

//院长添加分配记录
export function addGivenRecord(form) {
  return alovaInstance.Post('/adminGiven/addGiven', form)
}